home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / irsim-ca.2 / irsim-ca / irsim-cap-9.2 / src / ana11 / graphics.h < prev    next >
Text File  |  1993-01-15  |  2KB  |  51 lines

  1. /*
  2.  *     ********************************************************************* 
  3.  *     * Copyright (C) 1988, 1990 Stanford University.                     * 
  4.  *     * Permission to use, copy, modify, and distribute this              * 
  5.  *     * software and its documentation for any purpose and without        * 
  6.  *     * fee is hereby granted, provided that the above copyright          * 
  7.  *     * notice appear in all copies.  Stanford University                 * 
  8.  *     * makes no representations about the suitability of this            * 
  9.  *     * software for any purpose.  It is provided "as is" without         * 
  10.  *     * express or implied warranty.  Export of this software outside     * 
  11.  *     * of the United States of America may require an export license.    * 
  12.  *     *********************************************************************
  13.  */
  14.  
  15.  
  16. #define    VLine( WIND, X, BOT, TOP, GCX )                    \
  17.   XFillRectangle( display, WIND, GCX, X, TOP, 1, (BOT) - (TOP) + 1 )
  18.  
  19. #define    HLine( WIND, LEFT, RIGHT, Y, GCX )                \
  20.   XFillRectangle( display, WIND, GCX, LEFT, Y, (RIGHT) - (LEFT) + 1, 1 )
  21.  
  22. #define FillAREA( WIND, X, Y, WIDTH, HEIGHT, GCX )            \
  23.     XFillRectangle( display, WIND, GCX, X, Y, WIDTH, HEIGHT )
  24.  
  25. #define    InvAREA( WIND, X, Y, WIDTH, HEIGHT )                \
  26.     XFillRectangle( display, WIND, gcs.inv, X, Y, WIDTH, HEIGHT )
  27.  
  28. #define    BWID( Bx )        ( (Bx).right - (Bx).left + 1 )
  29. #define    BHIG( Bx )        ( (Bx).bot - (Bx).top + 1 )
  30.  
  31. #define FillBox( WIND, B, GCX )                        \
  32.     XFillRectangle( display, WIND, GCX, B.left, B.top, BWID(B), BHIG(B) )
  33.  
  34. #define InvBox( W, B )                        \
  35.  XFillRectangle( display, W, gcs.invert, (B).left, (B).top, BWID(B), BHIG(B) )
  36.  
  37. #define    OutlineBox( WIND, B, GCX )                    \
  38.  XDrawRectangle( display, WIND, GCX, (B).left, (B).top, BWID(B)-1, BHIG(B)-1 )
  39.  
  40. #define StrLeft( WIND, S, LEN, LEFT, BOT, GCX )                \
  41.     XDrawImageString( display, WIND, GCX, LEFT, (BOT) - descent, S, LEN )
  42.  
  43. #define StrRight( WIND, S, LEN, RIGHT, BOT, GCX )            \
  44.     XDrawImageString( display, WIND, GCX,                \
  45.      (RIGHT) - (LEN) * CHARWIDTH +1, (BOT) - descent, S, LEN )
  46.  
  47. #define StrCenter( WIND, S, LEN, LEFT, RIGHT, BOT, GCX )        \
  48.   XDrawImageString( display, WIND, GCX,                    \
  49.   ((RIGHT) + (LEFT) - CHARWIDTH * (LEN)) / 2, (BOT) - descent, S, LEN )
  50.  
  51.